using System;
using System.Collections.Generic;
using System.Text;

namespace Crank.Core.Strings
{
    class NounFactory
    {
        private PluralizationAssumption lean;

        public NounFactory( PluralizationAssumption lean)
        {
            this.lean = lean;
        }

        public Noun CreateFrom(string word)
        {
            string singular, plural;
            switch (lean)
            {
                case PluralizationAssumption.AssumeSingular:
                    singular = word;
                    plural = Inflector.Pluralize(word);
                    break;
                case PluralizationAssumption.AssumePlural:
                    singular = Inflector.Singularize(word);
                    plural = word;
                    break;
                default:
                    throw new InvalidOperationException("Not sure how to create a Noun of that type" + lean.ToString());
            }

            return new Noun(singular, plural);
        }
    }
}
